package com.cango.student.io.ioStudy;

import java.io.*;

/**
 * 简单例子
 */
public class Sample {
    public static void main(String[] args) {
        try (FileInputStream fis = new FileInputStream(new File("D:\\1.txt"));
             FileOutputStream fos = new FileOutputStream(new File("D:\\erp-sms-web.log"))) {
            int ch;
            while ((ch = fis.read()) != -1) {
                System.out.println((char) ch);
                fos.write(ch);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
